<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" import="com.wit.po.Area" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>客户区域新增</title>
<link href="../style/main.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="stylesheet"  href="../style/style.css" />

<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript">
	function addNewArea()
	{
		var id = editAreaForm.areaId.value;
		var supid = editAreaForm.supAreaId.value;
		if(id.length-supid.length == <%=Area.STEP_LEN_OF_LEVEL %>)
		{
			editAreaForm.submit();
		}
		else
		{
			alert("区域编号只能比父区域多<%=Area.STEP_LEN_OF_LEVEL %>位");
		}
	}
</script>
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0" class="table">
  <tr>
    <td>
      <table width="100%" cellpadding="0" cellspacing="0" class="table2">
        <tr>
          <td valign="top">
            <div class="search" style="padding:10px">
            	<s:form id="editAreaForm" name="editAreaForm" action="area!addArea" method="post" theme="simple">
            	  <s:hidden id="supAreaId" name="area.supAreaId" value="%{#parameters.supAreaId}"></s:hidden>
            	  
	              <table cellpadding="0" cellspacing="0" width="100%" class="table5">
	                  <tr>
	                    <th height="29" bgcolor="#BBD2F7" class="title">增加区域</th>
	                </tr>
	                  <tbody>
	                    <tr>
	                     <td valign="top">
	                     <table width="100%" border="0" cellspacing="0" cellpadding="0">
	                         <tr>
	                           <td>上级区域：</td>
	                           <td>
	                           		<s:property value="%{#parameters.supAreaId}" default="0"/>
	                           </td>
	                         </tr>
	                         <tr>
	                           <td>区域编号：</td>
	                           <td>
	                           		<s:textfield id="areaId" name="area.areaId" value="%{#parameters.supAreaId}" required="true" />
	                           </td>
	                         </tr>
	                         <tr>
	                           <td>区域名称：</td>
	                           <td>
	                           		<s:textfield id="areaName" name="area.areaName" required="true" />
							   </td>
	                         </tr>
	                       </table>
                       <table width="100%" border="0" cellspacing="0" cellpadding="0">
			        <tr>
			          <td align="center" style="padding-right:10px; border-top:solid 1px #A8CFEB">
			          	<a onclick="javascript:addNewArea();" href="javascript:void(0);"><span class="clientinfo_but" >确&nbsp;定</span></a>&nbsp;&nbsp;&nbsp;&nbsp;
			          	<a onclick="" href="javascript:void(0);"><span class="clientinfo_but" >取&nbsp;消</span></a>
			          </td>
			        </tr>
			      </table></td>
                    </tr>
                  </tbody>
                </table>
	          </s:form>
            </div>

		  </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
